<?php
function formatDate($date, $formatStr) {
	return date_format(date_create($date), $formatStr);
}

function formatToDbDate($date, $formatStr) {
	return date_format(date_create($date), $formatStr);
}

function createCalendar($fieldId, $calendarId, $format){
	return ("<input type='image'
	src='images/calendar.png' id='$calendarId' class='formfield' /> <script type='text/javascript'>//<![CDATA[
		  Zapatec.Calendar.setup({
			firstDay          : 1,
			electric          : false,
			inputField        : \"$fieldId\",
			button            : \"$calendarId\",
			ifFormat          : \"$format\",
			daFormat          : \"$format\"
		  });
		//]]></script>
		");
}
?>